import time
from functools import wraps


def decorator(func):
    # 修复装饰器会导致函数名发生变化的问题
    @wraps(func)
    def wrapper(*args, **kw):
        print(time.time())
        func(*args, **kw)

    return wrapper


@decorator
def f1(param):
    """
    装饰器会导致函数名发生变化,变成了 wrapper
    :param param:
    :return:
    """

    print(f1.__name__)
    print("This is function1, param: " + param)


f1('test')
